Repository navigation
fix(apple): press Home through simulator HID on a foldable simulator - #5079
Conversation
XCUIDevice's home press never reaches SpringBoard on the iPhone Duo simulator, so home and app-switcher reported success while the app stayed in the foreground. Route both through the fold helper's simulator HID on a foldable simulator, the same routing orientation uses: one consumer Menu key press for home, two for the app switcher.
|
Thanks for the fix. The diff at 92fb89d routes Home through the simulator HID path on a foldable simulator, and the code has no problems that need to change before merge. Smoke Tests (ios) failed at 'Restore and build iOS XCTest runner' because the runner could not find the actions/cache save action. This is an infrastructure failure, and the diff touches no workflow file or Apple runner build step. The smoke phases never ran, so no smoke test exercised this change. Coverage failed on a 5000ms timeout in packages/capture-kit/src/snapshot/tests/snapshot-diff-scale.test.ts, which this diff does not touch, so it looks like a flaky timeout. The four Body rules runs were cancelled by concurrency after new pushes, not by a rule violation. There are no conflicts. Before merge, re-run Smoke Tests (ios) and Coverage, and confirm on the Coverage re-run that the new fold-helper code is covered. Not verified here: a foldable simulator run, the changed code, or the tests. The closed, half-open and open pose results rest on the PR body. The claims that the XCUIDevice home press never reaches SpringBoard on a foldable simulator and that the Menu key (0x0c/0x40) does rest on the author's measurement. |
|
Thanks for the review. Both reruns are green on 92fb89d: Smoke Tests (ios) and Coverage now pass, and all 17 checks pass. Coverage of the new code: the CI job doesn't print per-file numbers, so I ran the platform-apple tests with v8 coverage locally on 92fb89d.
|
Summary
On a foldable iOS simulator (iPhone Duo),
homeandapp-switcherreported success, but the app stayed in the foreground. XCUITest'sXCUIDevice.shared.press(.home)never reaches SpringBoard there.On a simulator with more than one panel, both commands now press Home through the fold helper's simulator HID: one consumer Menu key for
home, two forapp-switcher. This is the same routingorientationalready uses. Single-panel simulators, physical devices, tvOS, and macOS keep the runner press.Scope:
help foldablealso documents reaching Split View through SpringBoard.Before / after
iPhone Duo, iOS 27.2, open pose, app in front:
Screenshots after each command, base left, head right:
Validation
pnpm check:affected --run --head 92fb89d: passed,exactCommit: true.node bin/agent-device.mjsat head on an iPhone Duo simulator (iOS 27.2, default set).homeandapp-switchereach passed in the closed, half-open, and open poses, checked withappstateand the screenshots above. The Split View steps were checked by hand with agent-device 0.21.39.--ios-simulator-device-set), and a live single-panel simulator. Unit tests cover the single-panel routing.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.